package cn.com.checne.controller.superManager;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.time.DateFormatUtils;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import cn.com.checne.constants.Constants;
import cn.com.checne.controller.BaseController;
import cn.com.checne.dao.JobCategoryDao;
import cn.com.checne.dao.JobDeptDao;
import cn.com.checne.dao.JobInfoDao;
import cn.com.checne.dao.JobNewsInfoDao;
import cn.com.checne.dao.LogInfoDao;
import cn.com.checne.dao.ResumeInfoDao;
import cn.com.checne.model.domain.JobCategory;
import cn.com.checne.model.domain.JobDept;
import cn.com.checne.model.domain.JobInfo;
import cn.com.checne.model.domain.JobNewsInfo;
import cn.com.checne.model.domain.ResumeCertificateInfo;
import cn.com.checne.model.domain.ResumeEducationInfo;
import cn.com.checne.model.domain.ResumeInfo;
import cn.com.checne.model.domain.ResumeWorkInfo;
import cn.com.checne.model.dto.JobNewsQuery;
import cn.com.checne.model.dto.JobQuery;
import cn.com.checne.model.dto.ResumeQuery;
import cn.com.checne.util.PageBean;
import cn.com.checne.util.StringTools;
import cn.com.checne.util.WebUtils;
import cn.com.checne.util.images.ImageContentUtils;

@Controller
@RequestMapping(value = "/super/job")
public class JobInfoManagerController extends BaseController{

    protected static final Logger logger = Logger.getLogger(JobInfoManagerController.class);
    @Resource
    private JobCategoryDao cateDao;
    @Resource
    private JobDeptDao deptDao;
    @Resource
    private JobNewsInfoDao jobNewsDao;
    @Resource
    private JobInfoDao jobDao;
    @Resource
    private LogInfoDao logDao;
    @Resource
    private ResumeInfoDao resumeDao;

    //招聘--首页
    @RequestMapping(value = "/index.do")
    public String index(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws Exception {
        return "super/frame/frame_job";
    }

    //招聘--左侧导航
    @RequestMapping(value = "/left.do")
    public String left(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws Exception {
        return "super/job/left";
    }

    /**
     * ************************************************************************************************************************
     *
     **************************************************招聘栏目管理***********************************************************
     *
     * ***********************************************************************************************************************
     */
    //招聘--列举所有的栏目
    @RequestMapping(value = "/category-list.do")
    public ModelAndView categoryList(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws Exception {
        ModelAndView mav = new ModelAndView();
        int languageId = (String) request.getSession().getAttribute(Constants.SESSIONLANGUAGE) != null ? Integer.parseInt((String) request.getSession().getAttribute(Constants.SESSIONLANGUAGE)) : 1;
        List<JobCategory> cateList = cateDao.getAll(languageId, -1);
        modelMap.put("cateList", cateList);
        modelMap.put("languageId", languageId);
        mav.setViewName("super/job/category-list");
        mav.addAllObjects(modelMap);
        return mav;
    }

    //招聘--栏目新增、修改页面
    @RequestMapping(value = "/category-show.do")
    public ModelAndView categoryShow(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws Exception {
        ModelAndView mav = new ModelAndView();
        int cateId = WebUtils.getRequestParameterAsInt(request, "cateId", 0);
        int languageId = (String) request.getSession().getAttribute(Constants.SESSIONLANGUAGE) != null ? Integer.parseInt((String) request.getSession().getAttribute(Constants.SESSIONLANGUAGE)) : 1;
        JobCategory cate = new JobCategory();
        cate.setLanguageId(languageId);

        String opt = "create";
        if (cateId > 0) {
            cate = cateDao.getJobCategory(cateId);
            opt = "update";
        }
        modelMap.put("cate", cate);
        modelMap.put("opt", opt);
        mav.setViewName("super/job/category-show");
        mav.addAllObjects(modelMap);
        return mav;
    }

    //招聘--栏目新增
    @RequestMapping(value = "/category-create.do")
    public ModelAndView categoryCreate(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws Exception {
        ModelAndView mav = new ModelAndView();
        String message = "";
        JobCategory cate = new JobCategory();
        cate.setLanguageId(WebUtils.getRequestParameterAsInt(request, "languageId", 1));
        cate.setShowType(WebUtils.getRequestParameterAsInt(request, "showType", 0));
        cate.setIsJob(WebUtils.getRequestParameterAsInt(request, "isJob", 0));
        cate.setName(WebUtils.getRequestParameterAsString(request, "name"));
        cate.setDesc(WebUtils.getRequestParameterAsString(request, "desc"));
        cate.setOrder(WebUtils.getRequestParameterAsInt(request, "order", 0));
        if (cateDao.create(cate)) {
            message = "招聘栏目创建成功!";
        } else {
            message = "招聘栏目创建失败!";
        }
        modelMap.put("message", message);
        modelMap.put("href", "super/job/category-list.do");
        mav.setViewName("common/message");
        mav.addAllObjects(modelMap);
        return mav;
    }

    //招聘--栏目修改
    @RequestMapping(value = "/category-update.do")
    public ModelAndView categoryUpdate(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws Exception {
        ModelAndView mav = new ModelAndView();
        String message = "";
        JobCategory cate = new JobCategory();
        int cateId = WebUtils.getRequestParameterAsInt(request, "cateId", 0);
        cate = cateDao.getJobCategory(cateId);
        cate.setLanguageId(WebUtils.getRequestParameterAsInt(request, "languageId", 1));
        cate.setShowType(WebUtils.getRequestParameterAsInt(request, "showType", 0));
        cate.setIsJob(WebUtils.getRequestParameterAsInt(request, "isJob", 0));
        cate.setName(WebUtils.getRequestParameterAsString(request, "name"));
        cate.setDesc(WebUtils.getRequestParameterAsString(request, "desc"));
        cate.setOrder(WebUtils.getRequestParameterAsInt(request, "order", 0));
        if (cateDao.update(cate)) {
            message = "招聘栏目修改成功!";
        } else {
            message = "招聘栏目修改失败!";
        }
        modelMap.put("message", message);
        modelMap.put("href", "super/job/category-list.do");
        mav.setViewName("common/message");
        mav.addAllObjects(modelMap);
        return mav;
    }

    //招聘--栏目删除
    @RequestMapping(value = "/category-del.do")
    public ModelAndView categoryDel(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws Exception {
        ModelAndView mav = new ModelAndView();
        String message = "";
        int cateId = WebUtils.getRequestParameterAsInt(request, "cateId", 0);
        if (cateDao.delete(cateId)) {
            message = "招聘栏目删除成功!";
        } else {
            message = "招聘栏目删除失败!";
        }
        modelMap.put("message", message);
        modelMap.put("href", "super/job/category-list.do");
        mav.setViewName("common/message");
        mav.addAllObjects(modelMap);
        return mav;
    }

    /**
     * ************************************************************************************************************************
     *
     **************************************************招聘部门管理***********************************************************
     *
     * ***********************************************************************************************************************
     */
    //招聘--部门-列举所有
    @RequestMapping(value = "/dept-list.do")
    public ModelAndView deptList(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws Exception {
        ModelAndView mav = new ModelAndView();
        int languageId = (String) request.getSession().getAttribute(Constants.SESSIONLANGUAGE) != null ? Integer.parseInt((String) request.getSession().getAttribute(Constants.SESSIONLANGUAGE)) : 1;
        List<JobDept> deptList = deptDao.getAll(languageId);
        modelMap.put("deptList", deptList);
        modelMap.put("languageId", languageId);
        mav.setViewName("super/job/dept-list");
        mav.addAllObjects(modelMap);
        return mav;
    }

    //招聘--部门-栏目新增、修改页面
    @RequestMapping(value = "/dept-show.do")
    public ModelAndView deptShow(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws Exception {
        ModelAndView mav = new ModelAndView();
        int deptId = WebUtils.getRequestParameterAsInt(request, "deptId", 0);
        int languageId = (String) request.getSession().getAttribute(Constants.SESSIONLANGUAGE) != null ? Integer.parseInt((String) request.getSession().getAttribute(Constants.SESSIONLANGUAGE)) : 1;
        JobDept dept = new JobDept();
        dept.setLanguageId(languageId);
        String opt = "create";
        if (deptId > 0) {
            dept = deptDao.getJobDept(deptId);
            opt = "update";
        }
        modelMap.put("dept", dept);
        modelMap.put("opt", opt);
        mav.setViewName("super/job/dept-show");
        mav.addAllObjects(modelMap);
        return mav;
    }

    //招聘--部门--新增
    @RequestMapping(value = "/dept-create.do")
    public ModelAndView deptCreate(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws Exception {
        ModelAndView mav = new ModelAndView();
        String message = "";
        JobDept dept = new JobDept();
        dept.setLanguageId(WebUtils.getRequestParameterAsInt(request, "languageId", 1));
        dept.setName(WebUtils.getRequestParameterAsString(request, "name"));
        dept.setDesc(WebUtils.getRequestParameterAsString(request, "desc"));
        dept.setOrder(WebUtils.getRequestParameterAsInt(request, "order", 0));
        if (deptDao.create(dept)) {
            message = "招聘部门创建成功!";
        } else {
            message = "招聘部门创建失败!";
        }
        modelMap.put("message", message);
        modelMap.put("href", "super/job/dept-list.do");
        mav.setViewName("common/message");
        mav.addAllObjects(modelMap);
        return mav;
    }

    //招聘--部门--修改
    @RequestMapping(value = "/dept-update.do")
    public ModelAndView deptUpdate(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws Exception {
        ModelAndView mav = new ModelAndView();
        String message = "";
        JobDept dept = new JobDept();
        int deptId = WebUtils.getRequestParameterAsInt(request, "deptId", 0);
        dept = deptDao.getJobDept(deptId);
        dept.setLanguageId(WebUtils.getRequestParameterAsInt(request, "languageId", 1));
        dept.setName(WebUtils.getRequestParameterAsString(request, "name"));
        dept.setDesc(WebUtils.getRequestParameterAsString(request, "desc"));
        dept.setOrder(WebUtils.getRequestParameterAsInt(request, "order", 0));
        if (deptDao.update(dept)) {
            message = "招聘部门修改成功!";
        } else {
            message = "招聘部门修改失败!";
        }
        modelMap.put("message", message);
        modelMap.put("href", "super/job/dept-list.do");
        mav.setViewName("common/message");
        mav.addAllObjects(modelMap);
        return mav;
    }

    //招聘--部门--删除
    @RequestMapping(value = "/dept-del.do")
    public ModelAndView deptDel(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws Exception {
        ModelAndView mav = new ModelAndView();
        String message = "";
        int deptId = WebUtils.getRequestParameterAsInt(request, "deptId", 0);
        if (deptDao.delete(deptId)) {
            message = "招聘部门删除成功!";
        } else {
            message = "招聘部门删除失败!";
        }
        modelMap.put("message", message);
        modelMap.put("href", "super/job/dept-list.do");
        mav.setViewName("common/message");
        mav.addAllObjects(modelMap);
        return mav;
    }

    /**
     * ************************************************************************************************************************
     *
     **************************************************招聘新闻管理***********************************************************
     *
     * ***********************************************************************************************************************
     */
    //招聘--新闻--列举所有
    @RequestMapping(value = "/jobNews-list.do")
    public ModelAndView jobNewsList(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws Exception {
        ModelAndView mav = new ModelAndView();
        int languageId = (String) request.getSession().getAttribute(Constants.SESSIONLANGUAGE) != null ? Integer.parseInt((String) request.getSession().getAttribute(Constants.SESSIONLANGUAGE)) : 1;
        List<JobCategory> cateList = cateDao.getAll(languageId, 0);

        String kw = WebUtils.getRequestParameterAsString(request, "kw");
        kw = StringTools.converISO2UTF8(kw);
        int cateId = WebUtils.getRequestParameterAsInt(request, "cateId", 0);
        int isShowIndex = WebUtils.getRequestParameterAsInt(request, "isShowIndex", -1);
        int isShowList = WebUtils.getRequestParameterAsInt(request, "isShowList", -1);
        int isTop = WebUtils.getRequestParameterAsInt(request, "isTop", -1);
        String startTime = WebUtils.getRequestParameterAsString(request, "startTime");
        String endTime = WebUtils.getRequestParameterAsString(request, "endTime");

        /*
         * if(StringUtils.isBlank(startTime)){ startTime = TimeUtils.getDate(new
         * Date(), "yyyy-MM-dd HH:mm:ss", Constants.SEARCH_DAYS); }
         * if(StringUtils.isBlank(endTime)){ endTime = TimeUtils.getDate(new
         * Date(),"yyyy-MM-dd HH:mm:ss", 0);
		}
         */
        JobNewsQuery query = new JobNewsQuery();
        query.setKw(kw);
        query.setLanguageId(languageId);
        query.setCateId(cateId);
        query.setIsShowIndex(isShowIndex);
        query.setIsShowList(isShowList);
        query.setIsTop(isTop);
        query.setStartTime(startTime);
        query.setEndTime(endTime);

        int curPage = WebUtils.getRequestParameterAsInt(request, "curPage", 1);
        PageBean pageBean = new PageBean();
        pageBean.setCurPage(curPage);
        List<JobNewsInfo> jobNewsList = jobNewsDao.getJobNewsListByCondition(query, pageBean.getStart(), pageBean.getRowsPerPage());
        pageBean.setMaxRowCount(jobNewsDao.getJobNewsCountByCondition(query));
        pageBean.setMaxPage();
        pageBean.setPageNoList();

        modelMap.put("cateList", cateList);
        modelMap.put("jobNewsList", jobNewsList);
        modelMap.put("query", query);
        modelMap.put("pageBean", pageBean);
        mav.setViewName("super/job/jobNews-list");
        mav.addAllObjects(modelMap);
        return mav;
    }

    //招聘--新闻--新增、修改页面
    @RequestMapping(value = "/jobNews-show.do")
    public ModelAndView jobNewsShow(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws Exception {
        ModelAndView mav = new ModelAndView();
        int jobNewsId = WebUtils.getRequestParameterAsInt(request, "jobNewsId", 0);
        int languageId = (String) request.getSession().getAttribute(Constants.SESSIONLANGUAGE) != null ? Integer.parseInt((String) request.getSession().getAttribute(Constants.SESSIONLANGUAGE)) : 1;
        List<JobCategory> cateList = cateDao.getAll(languageId, 0);
        JobNewsInfo jobNews = new JobNewsInfo();
        jobNews.setLanguageId(languageId);
        String opt = "create";
        if (jobNewsId > 0) {
            jobNews = jobNewsDao.getJobById(jobNewsId);
            String content = jobNews.getContent();
            jobNews.setContent(ImageContentUtils.setBasePathToImagePath(request,content));
            opt = "update";
        }
        modelMap.put("cateList", cateList);
        modelMap.put("opt", opt);
        modelMap.put("jobNews", jobNews);
        mav.setViewName("super/job/jobNews-show");
        mav.addAllObjects(modelMap);
        return mav;
    }

    //招聘--新闻--新增
    @RequestMapping(value = "/jobNews-create.do")
    public ModelAndView jobNewsCreate(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws Exception {
        ModelAndView mav = new ModelAndView();
        mav.setViewName("common/message");
        String message = "";
        JobNewsInfo jobNews = new JobNewsInfo();
        String content = WebUtils.getRequestParameterAsString(request, "content");
        if (StringUtils.isBlank(content)) {
            modelMap.put("message", "内容不能为空!");
            mav.addAllObjects(modelMap);
            return mav;
        }
        int languageId = WebUtils.getRequestParameterAsInt(request, "languageId", 1);
        int cateId = WebUtils.getRequestParameterAsInt(request, "cateId", 0);

        boolean createFlag = true;
        //首先判断选定的栏目是否支持列表、详情显示。如果是详情显示的话，需要进行更新操作。
        JobNewsInfo dbJobNews = jobNewsDao.isJobNewsExist(languageId, cateId);
        if (dbJobNews != null && dbJobNews.getJobCategory().getShowType() == 0) {
            createFlag = false;
            jobNews = jobNewsDao.getJobById(dbJobNews.getJobNewsId());
        }

        jobNews.setLanguageId(languageId);
        jobNews.setCateId(cateId);
        jobNews.setTitle(WebUtils.getRequestParameterAsString(request, "title"));
        jobNews.setAuthor(WebUtils.getRequestParameterAsString(request, "title"));
        jobNews.setPublishFrom(WebUtils.getRequestParameterAsString(request, "publishFrom"));
        jobNews.setAuthor(WebUtils.getRequestParameterAsString(request, "author"));
        jobNews.setPublishDate(new java.util.Date());
        jobNews.setMetaKeyword(WebUtils.getRequestParameterAsString(request, "metaKeyword"));
        jobNews.setMetaContent(WebUtils.getRequestParameterAsString(request, "metaContent"));
        jobNews.setSummary(jobNews.getMetaContent());

       
        
        Map<String,String> map = ImageContentUtils.removeImageBasePathForMap(request, content);
        jobNews.setContent(map.get("content"));
        jobNews.setFirstImage(map.get("firstImage"));

        if (createFlag) {
            if (jobNewsDao.create(jobNews)) {
                message = "招聘新闻成功!";
            } else {
                message = "招聘新闻失败!";
            }
        } else {
            if (jobNewsDao.update(jobNews)) {
                message = "招聘新闻更新成功!";
            } else {
                message = "招聘新闻更新失败!";
            }
        }
        modelMap.put("message", message);
        modelMap.put("href", "super/job/jobNews-list.do");
        mav.setViewName("common/message");
        mav.addAllObjects(modelMap);
        return mav;
    }

    //招聘--新闻--修改
    @RequestMapping(value = "/jobNews-update.do")
    public ModelAndView jobNewsUpdate(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws Exception {
        ModelAndView mav = new ModelAndView();
        String message = "";
        String content = WebUtils.getRequestParameterAsString(request, "content");
        if (StringUtils.isBlank(content)) {
            modelMap.put("message", "内容不能为空!");
            mav.addAllObjects(modelMap);
            return mav;
        }

        int jobNewsId = WebUtils.getRequestParameterAsInt(request, "jobNewsId", 0);
        JobNewsInfo jobNews = new JobNewsInfo();
        jobNews = jobNewsDao.getJobById(jobNewsId);

        jobNews.setLanguageId(WebUtils.getRequestParameterAsInt(request, "languageId", 1));
        jobNews.setCateId(WebUtils.getRequestParameterAsInt(request, "cateId", 0));
        jobNews.setTitle(WebUtils.getRequestParameterAsString(request, "title"));
        jobNews.setAuthor(WebUtils.getRequestParameterAsString(request, "title"));
        jobNews.setPublishFrom(WebUtils.getRequestParameterAsString(request, "publishFrom"));
        jobNews.setAuthor(WebUtils.getRequestParameterAsString(request, "author"));
        jobNews.setPublishDate(new java.util.Date());
        jobNews.setMetaKeyword(WebUtils.getRequestParameterAsString(request, "metaKeyword"));
        jobNews.setMetaContent(WebUtils.getRequestParameterAsString(request, "metaContent"));
        jobNews.setSummary(jobNews.getMetaContent());

       

        Map<String,String> map = ImageContentUtils.removeImageBasePathForMap(request, content);
        jobNews.setContent(map.get("content"));
        jobNews.setFirstImage(map.get("firstImage"));
        

        if (jobNewsDao.update(jobNews)) {
            message = "招聘新闻修改成功!";
        } else {
            message = "招聘新闻修改失败!";
        }
        modelMap.put("message", message);
        modelMap.put("href", "super/job/jobNews-list.do");
        mav.setViewName("common/message");
        mav.addAllObjects(modelMap);
        return mav;
    }

    //招聘--新闻--删除
    @RequestMapping(value = "/jobNews-del.do")
    public ModelAndView jobNewsDel(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws Exception {
        ModelAndView mav = new ModelAndView();
        String message = "招聘新闻删除成功!";
        String jobNewsId = WebUtils.getRequestParameterAsString(request, "jobNewsId");
        String ids[] = StringUtils.split(jobNewsId, ",");
        boolean flag = false;
        for (String id : ids) {
            flag = jobNewsDao.delete(Integer.parseInt(id));
            if (flag == false) {
                message = "招聘新闻删除失败!";
                break;
            }
        }
        modelMap.put("message", message);
        modelMap.put("href", "super/job/jobNews-list.do");
        mav.setViewName("common/message");
        mav.addAllObjects(modelMap);
        return mav;
    }

    //招聘--新闻首页显示设置
    @RequestMapping(value = "/jobNews-setIndex.do")
    public ModelAndView jobNewsSetIndex(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws Exception {
        ModelAndView mav = new ModelAndView();
        String message = "";
        String jobNewsId = WebUtils.getRequestParameterAsString(request, "jobNewsId");
        String flag = WebUtils.getRequestParameterAsString(request, "flag");
        if (StringUtils.isNotBlank(flag) && flag.matches("\\d+")) {
            String nds[] = StringUtils.split(jobNewsId, ",");
            int jobNewsIds[] = new int[nds.length];
            int i = 0;
            for (String nd : nds) {
                jobNewsIds[i] = Integer.valueOf(nd);
                i++;
            }
            if (jobNewsDao.setShowIndex(Integer.valueOf(flag), jobNewsIds)) {
                message = "" + (flag.equals("1") ? "设置首页显示" : "取消首页显示") + "成功!";
            } else {
                message = "" + (flag.equals("1") ? "设置首页显示" : "取消首页显示") + "失败!";
            }
        }

        modelMap.put("message", message);
        modelMap.put("href", "super/job/jobNews-list.do");
        mav.setViewName("common/message");
        mav.addAllObjects(modelMap);
        return mav;
    }

    //招聘--新闻--列表页显示设置
    @RequestMapping(value = "/jobNews-setList.do")
    public ModelAndView jobNewsSetList(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws Exception {
        ModelAndView mav = new ModelAndView();
        String message = "";
        String jobNewsId = WebUtils.getRequestParameterAsString(request, "jobNewsId");
        String flag = WebUtils.getRequestParameterAsString(request, "flag");
        if (StringUtils.isNotBlank(flag) && flag.matches("\\d+")) {
            String nds[] = StringUtils.split(jobNewsId, ",");
            int jobNewsIds[] = new int[nds.length];
            int i = 0;
            for (String nd : nds) {
                jobNewsIds[i] = Integer.valueOf(nd);
                i++;
            }
            if (jobNewsDao.setShowList(Integer.valueOf(flag), jobNewsIds)) {
                message = "" + (flag.equals("1") ? "设置列表页显示" : "取消列表页显示") + "成功!";
            } else {
                message = "" + (flag.equals("1") ? "设置列表页显示" : "取消列表页显示") + "失败!";
            }
        }

        modelMap.put("message", message);
        modelMap.put("href", "super/job/jobNews-list.do");
        mav.setViewName("common/message");
        mav.addAllObjects(modelMap);
        return mav;
    }

    /**
     * ************************************************************************************************************************
     *
     **************************************************招聘工作岗位管理***********************************************************
     *
     * ***********************************************************************************************************************
     */
    //招聘--工作岗位--列举所有
    @RequestMapping(value = "/job-list.do")
    public ModelAndView jobList(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws Exception {
        ModelAndView mav = new ModelAndView();
        int languageId = (String) request.getSession().getAttribute(Constants.SESSIONLANGUAGE) != null ? Integer.parseInt((String) request.getSession().getAttribute(Constants.SESSIONLANGUAGE)) : 1;
        List<JobCategory> cateList = cateDao.getAll(languageId, 1);
        List<JobDept> deptList = deptDao.getAll(languageId);

        String kw = WebUtils.getRequestParameterAsString(request, "kw");
        kw = StringTools.converISO2UTF8(kw);
        int cateId = WebUtils.getRequestParameterAsInt(request, "cateId", 0);
        int deptId = WebUtils.getRequestParameterAsInt(request, "deptId", 0);
        String startTime = WebUtils.getRequestParameterAsString(request, "startTime");
        String endTime = WebUtils.getRequestParameterAsString(request, "endTime");

        /*
         * if(StringUtils.isBlank(startTime)){ startTime = TimeUtils.getDate(new
         * Date(), "yyyy-MM-dd HH:mm:ss", Constants.SEARCH_DAYS); }
         * if(StringUtils.isBlank(endTime)){ endTime = TimeUtils.getDate(new
         * Date(),"yyyy-MM-dd HH:mm:ss", 0);
		}
         */
        JobQuery query = new JobQuery();
        query.setKw(kw);
        query.setLanguageId(languageId);
        query.setCateId(cateId);
        query.setDeptId(deptId);
        query.setStartTime(startTime);
        query.setEndTime(endTime);

        int curPage = WebUtils.getRequestParameterAsInt(request, "curPage", 1);
        PageBean pageBean = new PageBean();
        pageBean.setCurPage(curPage);
        List<JobInfo> jobList = jobDao.getJobListByCondition(query, pageBean.getStart(), pageBean.getRowsPerPage());
        pageBean.setMaxRowCount(jobDao.getJobCountByCondition(query));
        pageBean.setMaxPage();
        pageBean.setPageNoList();

        modelMap.put("cateList", cateList);
        modelMap.put("deptList", deptList);
        modelMap.put("jobList", jobList);
        modelMap.put("query", query);
        modelMap.put("pageBean", pageBean);
        mav.setViewName("super/job/job-list");
        mav.addAllObjects(modelMap);
        return mav;
    }

    //招聘--工作岗位--新增、修改页面
    @RequestMapping(value = "/job-show.do")
    public ModelAndView jobShow(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws Exception {
        ModelAndView mav = new ModelAndView();
        int jobId = WebUtils.getRequestParameterAsInt(request, "jobId", 0);
        int languageId = (String) request.getSession().getAttribute(Constants.SESSIONLANGUAGE) != null ? Integer.parseInt((String) request.getSession().getAttribute(Constants.SESSIONLANGUAGE)) : 1;
        List<JobCategory> cateList = cateDao.getAll(languageId, 1);
        List<JobDept> deptList = deptDao.getAll(languageId);

        JobInfo job = new JobInfo();
        job.setLanguageId(languageId);
        String opt = "create";
        if (jobId > 0) {
            job = jobDao.getJobById(jobId);
            String content = job.getRequirement();
            String replaceContent = ImageContentUtils.setBasePathToImagePath(request,content);
            job.setRequirement(replaceContent);
            opt = "update";
        }
        modelMap.put("cateList", cateList);
        modelMap.put("deptList", deptList);
        modelMap.put("opt", opt);
        modelMap.put("job", job);
        mav.setViewName("super/job/job-show");
        mav.addAllObjects(modelMap);
        return mav;
    }

    //招聘--工作岗位--新增
    @RequestMapping(value = "/job-create.do")
    public ModelAndView jobCreate(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws Exception {
        ModelAndView mav = new ModelAndView();
        String message = "";
        String responsibility = WebUtils.getRequestParameterAsString(request, "responsibility");
        String requirement = WebUtils.getRequestParameterAsString(request, "requirement");

        if (StringUtils.isBlank(requirement) || StringUtils.isBlank(responsibility)) {
            modelMap.put("message", "招聘内容不能为空!");
            mav.addAllObjects(modelMap);
            return mav;
        }

        JobInfo job = new JobInfo();

        job.setLanguageId(WebUtils.getRequestParameterAsInt(request, "languageId", 1));
        job.setCateId(WebUtils.getRequestParameterAsInt(request, "cateId", 0));
        job.setDeptId(WebUtils.getRequestParameterAsInt(request, "deptId", 0));

        job.setTitle(WebUtils.getRequestParameterAsString(request, "title"));
        job.setPerson(WebUtils.getRequestParameterAsInt(request, "person", 0));
        job.setAddress(WebUtils.getRequestParameterAsString(request, "address"));
        job.setContact(WebUtils.getRequestParameterAsString(request, "contact"));
        job.setResponsibility(WebUtils.getRequestParameterAsString(request, "responsibility"));
        
        requirement = ImageContentUtils.removeImageBasePathForString(requirement, request);
        
        job.setRequirement(requirement);
        job.setPublishDate(new java.util.Date());

        if (jobDao.create(job)) {
            message = "招聘工作岗位成功!";
        } else {
            message = "招聘工作岗位失败!";
        }
        modelMap.put("message", message); 
        modelMap.put("href", "super/job/job-list.do"); 
        mav.setViewName("common/message");
        mav.addAllObjects(modelMap);
        return mav;
    }

    //招聘--工作岗位--修改
    @RequestMapping(value = "/job-update.do")
    public ModelAndView jobUpdate(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws Exception {
        ModelAndView mav = new ModelAndView();
        String message = "";
        String responsibility = WebUtils.getRequestParameterAsString(request, "responsibility");
        String requirement = WebUtils.getRequestParameterAsString(request, "requirement");

        if (StringUtils.isBlank(requirement) || StringUtils.isBlank(responsibility)) {
            modelMap.put("message", "招聘内容不能为空!");
            mav.addAllObjects(modelMap);
            return mav;
        }

        int jobId = WebUtils.getRequestParameterAsInt(request, "jobId", 0);
        JobInfo job = new JobInfo();
        job = jobDao.getJobById(jobId);

        job.setLanguageId(WebUtils.getRequestParameterAsInt(request, "languageId", 1));
        job.setCateId(WebUtils.getRequestParameterAsInt(request, "cateId", 0));
        job.setDeptId(WebUtils.getRequestParameterAsInt(request, "deptId", 0));

        job.setTitle(WebUtils.getRequestParameterAsString(request, "title"));
        job.setPerson(WebUtils.getRequestParameterAsInt(request, "person", 0));
        job.setAddress(WebUtils.getRequestParameterAsString(request, "address"));
        job.setContact(WebUtils.getRequestParameterAsString(request, "contact"));
        job.setResponsibility(WebUtils.getRequestParameterAsString(request, "responsibility"));
        
        requirement = ImageContentUtils.removeImageBasePathForString(requirement, request);
        job.setRequirement(requirement);
        
        job.setPublishDate(new java.util.Date());

        if (jobDao.update(job)) {
            message = "招聘工作岗位修改成功!";
        } else {
            message = "招聘工作岗位修改失败!";
        }
        modelMap.put("message", message);
        modelMap.put("href", "super/job/job-list.do"); 
        mav.setViewName("common/message");
        mav.addAllObjects(modelMap);
        return mav;
    }

    //招聘--工作岗位--删除
    @RequestMapping(value = "/job-del.do")
    public ModelAndView jobDel(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws Exception {
        ModelAndView mav = new ModelAndView();
        String message = "招聘岗位删除成功!";
        String jobId = WebUtils.getRequestParameterAsString(request, "jobId");
        String ids[] = StringUtils.split(jobId, ",");
        boolean flag = false;
        for (String id : ids) {
            flag = jobDao.delete(Integer.parseInt(id));
            if (flag == false) {
                message = "招聘岗位删除失败!";
                break;
            }
        }
        modelMap.put("message", message);
        modelMap.put("href", "super/job/job-list.do"); 
        mav.setViewName("common/message");
        mav.addAllObjects(modelMap);
        return mav;
    }

    //简历-列举所有
    @RequestMapping(value = "/resume-list.do")
    public ModelAndView resumeList(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws Exception {
        ModelAndView mav = new ModelAndView();
        int languageId = (String) request.getSession().getAttribute(Constants.SESSIONLANGUAGE) != null ? Integer.parseInt((String) request.getSession().getAttribute(Constants.SESSIONLANGUAGE)) : 1;

        String kw = WebUtils.getRequestParameterAsString(request, "kw");
        kw = StringTools.converISO2UTF8(kw);
        String startTime = WebUtils.getRequestParameterAsString(request, "startTime");
        String endTime = WebUtils.getRequestParameterAsString(request, "endTime");

        ResumeQuery query = new ResumeQuery();
        query.setKw(kw);
        query.setLanguageId(languageId);
        query.setStartTime(startTime);
        query.setEndTime(endTime);

        int curPage = WebUtils.getRequestParameterAsInt(request, "curPage", 1);
        PageBean pageBean = new PageBean();
        pageBean.setCurPage(curPage);
        List<ResumeInfo> resumeList = resumeDao.getResumeList(query, pageBean.getStart(), pageBean.getRowsPerPage());
        pageBean.setMaxRowCount(resumeDao.getResumeCount(query));
        pageBean.setMaxPage();
        pageBean.setPageNoList();

        modelMap.put("resumeList", resumeList);
        modelMap.put("query", query);
        modelMap.put("pageBean", pageBean);
        mav.setViewName("super/job/resume-list");
        mav.addAllObjects(modelMap);
        return mav;
    }

    //简历--预览
    @RequestMapping(value = "/resume-view.do")
    public ModelAndView resumeView(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws Exception {
        ModelAndView mav = new ModelAndView();
        String resumeId = WebUtils.getRequestParameterAsString(request, "resumeId", "0");
        ResumeInfo resume = resumeDao.getResumeById(resumeId);
        modelMap.put("resume", resume);
        mav.setViewName("super/job/resume-view");
        mav.addAllObjects(modelMap);
        return mav;
    }

    //简历--删除
    @RequestMapping(value = "/resume-del.do")
    public ModelAndView resumeDel(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws Exception {
        ModelAndView mav = new ModelAndView();
        String message = "简历删除成功!";
        String resumeId = WebUtils.getRequestParameterAsString(request, "resumeId");
        String ids[] = StringUtils.split(resumeId, ",");
        boolean flag = false;
        for (String id : ids) {
            flag = resumeDao.delete(id);
            if (flag == false) {
                message = "简历删除失败!";
                break;
            }
        }
        modelMap.put("message", message);
        modelMap.put("href", "super/job/resume-list.do");
        mav.setViewName("common/message");
        mav.addAllObjects(modelMap);
        return mav;
    }

//	resume-export-wps
    @RequestMapping(value = "/resume-export-wps.do")
    public void resumeExportWPS(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws Exception {
        String resumeId = WebUtils.getRequestParameterAsString(request, "resumeId", "0");
        ResumeInfo resume = resumeDao.getResumeById(resumeId);

        response.setCharacterEncoding("UTF-8");
        response.setContentType("application/octet-stream");
        response.setHeader("Location", resume.getName());
        response.setHeader("Cache-Control", "max-age=1000");
        response.setHeader("Content-Disposition", "attachment; filename=" + resume.getName() + ".wps");

        StringBuffer content = new StringBuffer();


        content.append("   <table width=816 height=1663 border=0 align=center cellpadding=0 cellspacing=0 class=table>");
        content.append("  <tr>");
        content.append("    <td height=32 colspan=2 bgcolor=#EFEFEF class=table><p align=center><strong>CHEC</strong>应聘人员信息表 </p></td>");
        content.append("  </tr>");
        content.append("  <tr>");
        content.append("    <td height=32 colspan=2 align=right class=table><table width=100% border=0 cellspacing=0 cellpadding=0>");
        content.append("      <tr>");
        content.append("        <td width=67% align=right class=12>&nbsp;</td>");
        content.append("        <td width=10% align=center class=12>到岗日期：</td>");
        content.append("        <td width=23% height=32 class=12>&nbsp;</td>");
        content.append("      </tr>");
        content.append("    </table> </td>");
        content.append("  </tr>");
        content.append("  <tr>");
        content.append("    <td width=652 height=32 align=center class=table><table width=100% border=0 cellpadding=0 cellspacing=0 class=12>");
        content.append("      <tr>");
        content.append("        <td width=10% height=32 align=center bgcolor=#F7F7F7 class=12>应聘岗位：</td>");
        content.append("        <td width=32% class=12>&nbsp;" + resume.getJobInfo().getTitle() + "</td>");
        content.append("        <td width=10% height=26 align=center bgcolor=#F7F7F7 class=12>报名日期：</td>");
        content.append("        <td width=48% class=12>" + DateFormatUtils.format(resume.getResumeTime(), "yyyy-MM-dd") + "</td>");
        content.append("      </tr>");
        content.append("    </table></td>");
        content.append("    <td width=164 rowspan=6 align=center valign=top class=table><br></td>");
        content.append("  </tr>");
        content.append("  <tr>");
        content.append("    <td height=30 align=center class=table><table width=100% border=0 cellspacing=0 cellpadding=0>");
        content.append("      <tr>");
        content.append("        <td width=10% height=32 align=center bgcolor=#F7F7F7 class=12>姓&nbsp;&nbsp;&nbsp;名：</td>");
        content.append("        <td width=20% align=center class=12>" + resume.getName() + "</td>");
        content.append("        <td width=10% align=center bgcolor=#F7F7F7 class=12>性&nbsp;&nbsp;&nbsp;别：</td>");
        content.append("        <td width=14% align=center class=12>" + (resume.getGender() == 1 ? "男" : "女") + "</td>");
        content.append("        <td width=10% align=center bgcolor=#F7F7F7 class=12>民&nbsp;&nbsp;&nbsp;族：</td>");
        content.append("        <td width=16% align=center class=12>" + resume.getNation() + "</td>");
        content.append("        <td width=10% align=center bgcolor=#F7F7F7 class=12>籍&nbsp;&nbsp;&nbsp;贯：</td>");
        content.append("        <td width=10% align=center class=12>&nbsp;</td>");
        content.append("      </tr>");
        content.append("    </table></td>");
        content.append("  </tr>");
        content.append("  <tr>");
        content.append("    <td height=29 align=center class=table><table width=100% border=0 cellspacing=0 cellpadding=0>");
        content.append("      <tr>");
        content.append("        <td width=10% height=32 align=center bgcolor=#F7F7F7 class=12>出生地：</td>");
        content.append("        <td width=27% align=center class=12>&nbsp;</td>");
        content.append("        <td width=10% align=center bgcolor=#F7F7F7 class=12>政治面貌：</td>");
        content.append("        <td width=18% align=center class=12>" + (resume.getPoliticsStatus() == 1 ? "党员" : "群众") + "</td>");
        content.append("        <td width=10% align=center bgcolor=#F7F7F7 class=12>加入时间：</td>");
        content.append("        <td width=25% align=center class=12>&nbsp;</td>");
        content.append("      </tr>");
        content.append("    </table></td>");
        content.append("  </tr>");


        content.append("  <tr>");
        content.append("    <td height=32 align=center class=table><table width=100% border=0 cellspacing=0 cellpadding=0>");
        content.append("      <tr>");
        content.append("        <td width=16% align=center bgcolor=#F7F7F7>身份证号码：</td>");
        content.append("        <td width=84% height=32 align=center>&nbsp;</td>");
        content.append("      </tr>");
        content.append("    </table></td>");
        content.append("  </tr>");
        content.append("  <tr>");
        content.append("    <td height=32 align=center class=table><table width=100% border=0 cellspacing=0 cellpadding=0>");
        content.append("      <tr>");
        content.append("        <td width=16% height=32 align=center bgcolor=#F7F7F7 class=12>职称/专业资质：</td>");
        content.append("        <td width=38% height=32 align=center class=12>&nbsp;</td>");
        content.append("        <td width=15% align=center bgcolor=#F7F7F7 class=12>相关工作年限：</td>");
        content.append("        <td width=31% align=center class=12>&nbsp;</td>");
        content.append("      </tr>");
        content.append("    </table></td>");
        content.append("  </tr>");
        content.append("  <tr>");
        content.append("    <td height=32 align=center class=table><table width=100% border=0 cellspacing=0 cellpadding=0>");
        content.append("      <tr>");
        content.append("        <td width=16% height=32 align=center bgcolor=#F7F7F7 class=12>参加工作时间：</td>");
        content.append("        <td width=38% height=32 align=center class=12>&nbsp;</td>");
        content.append("        <td width=15% align=center bgcolor=#F7F7F7 class=12>外&nbsp;语&nbsp;程&nbsp;度：</td>");
        content.append("        <td width=31% align=center class=12>&nbsp;</td>");
        content.append("      </tr>");
        content.append("    </table></td>");
        content.append("  </tr>");
        content.append("  <tr>");
        content.append("    <td height=32 colspan=2 align=center class=table><table width=100% border=0 cellspacing=0 cellpadding=0>");
        content.append("        <tr>");
        content.append("          <td width=12% height=32 align=center bgcolor=#F7F7F7 class=12>户口所在地：</td>");
        content.append("          <td width=42% height=32 align=center class=12><strong>&nbsp; </strong></td>");
        content.append("          <td width=13% align=center bgcolor=#F7F7F7 class=12>档案存放单位： </td>");
        content.append("          <td width=33% height=32 align=center class=12>&nbsp;</td>");
        content.append("        </tr>");
        content.append("    </table></td>");
        content.append("  </tr>");
        content.append("  <tr>");
        content.append("    <td height=29 colspan=2 align=center class=table><table width=100% border=0 cellspacing=0 cellpadding=0>");
        content.append("      <tr>");
        content.append("        <td width=8% align=center bgcolor=#F7F7F7>家庭住址：</td>");
        content.append("        <td width=37% height=32 align=center>&nbsp;</td>");
        content.append("        <td width=5% align=center bgcolor=#F7F7F7>邮编：</td>");
        content.append("        <td width=17% align=center>&nbsp;</td>");
        content.append("        <td width=8% align=center bgcolor=#F7F7F7>联系电话：</td>");
        content.append("        <td width=25% height=32 align=center>" + resume.getTelephone() + "</td>");
        content.append("      </tr>");
        content.append("    </table></td>");
        content.append("  </tr>");
        content.append("  <tr>");
        content.append("    <td height=30 colspan=2 align=center class=table><table width=100% border=0 cellspacing=0 cellpadding=0>");
        content.append("        <tr>");
        content.append("          <td width=8% align=center bgcolor=#F7F7F7>E-MAIL：</td>");
        content.append("          <td width=37% height=32 align=center>" + resume.getEmail() + "</td>");
        content.append("          <td width=5% align=center bgcolor=#F7F7F7>手机：</td>");
        content.append("          <td width=17% align=center>&nbsp;</td>");
        content.append("          <td width=8% align=center bgcolor=#F7F7F7>婚姻状况： </td>");
        content.append("          <td width=25% height=32 align=center>" + (resume.getMarriageStatus() == 1 ? "已婚" : "未婚") + "</td>");
        content.append("        </tr>");
        content.append("    </table></td>");
        content.append("  </tr>");
        content.append("  <tr>");
        content.append("    <td height=30 colspan=2 align=center class=table><table width=100% border=0 cellspacing=0 cellpadding=0>");
        content.append("      <tr>");
        content.append("        <td width=14% height=32 align=center bgcolor=#F7F7F7 class=12><p class=12>在京住房状况：</p>          </td>");
        content.append("        <td width=86% align=center class=12>&nbsp;</td>");
        content.append("      </tr>");
        content.append("    </table>    </td>");
        content.append("  </tr>");
        content.append("  <tr>");
        content.append("    <td height=32 colspan=2 align=center bgcolor=#EFEFEF class=table>");
        content.append("<strong>教&nbsp;&nbsp;&nbsp;&nbsp;育&nbsp;&nbsp;&nbsp;&nbsp;培&nbsp;&nbsp;&nbsp;&nbsp;训</strong></td>");
        content.append(" </tr>");
        content.append("  <tr>");
        content.append("    <td colspan=2 align=center class=table><table width=100% height=180 border=0 cellpadding=0 cellspacing=0>");
        content.append("     <tr>");
        content.append("       <td height=32 colspan=2 align=center bgcolor=#F7F7F7 class=12>起止时间</td>");
        content.append("        <td width=25% height=32 align=center bgcolor=#F7F7F7 class=12>毕业学校</td>");
        content.append("        <td width=19% height=32 align=center bgcolor=#F7F7F7 class=12>专业</td>");
        content.append("        <td width=7% height=32 align=center bgcolor=#F7F7F7 class=12>学历</td>");
        content.append("        <td width=7% height=32 align=center bgcolor=#F7F7F7 class=12>学位</td>");
        content.append("        <td width=17% height=32 align=center bgcolor=#F7F7F7 class=12>学习形式</td>");
        content.append("      </tr>");
        for (ResumeEducationInfo ed : resume.getResumeEducationList()) {
            content.append("      <tr>");
            content.append("        <td width=13% height=32 align=right class=12>" + ed.getStart() + "至</td>");
            content.append("        <td width=12% height=32 align=center class=12>" + ed.getEnd() + "</td>");
            content.append("        <td height=32 align=center class=12>" + ed.getSchool() + "</td>");
            content.append("        <td height=32 align=center class=12>" + ed.getProfession() + "</td>");
            content.append("        <td height=32 align=center class=12>" + ed.getBackground() + "</td>");
            content.append("        <td height=32 align=center class=12>" + ed.getEgree() + "</td>");
            content.append("        <td height=32 align=center class=12>" + ed.getCategory() + "</td>");
            content.append("      </tr>");
        }
        content.append("    </table></td>");
        content.append("  </tr>");
        content.append("  <tr>");
        content.append("    <td height=32 colspan=2 align=center bgcolor=#EFEFEF class=table>");
        content.append(" <strong>工&nbsp;&nbsp;&nbsp;&nbsp;作&nbsp;&nbsp;&nbsp;&nbsp;经&nbsp;&nbsp;&nbsp;&nbsp;历</strong></td>");
        content.append("  </tr>");
        content.append("  <tr>");
        content.append("    <td colspan=2 align=center class=table><table width=100% height=161 border=0 cellpadding=0 cellspacing=0>");
        content.append("      <tr>");
        content.append("        <td height=32 colspan=2 align=center bgcolor=#F7F7F7 class=12>起止时间</td>");
        content.append("        <td width=29% height=32 align=center bgcolor=#F7F7F7 class=12>工作单位</td>");
        content.append("        <td width=26% height=32 align=center bgcolor=#F7F7F7 class=12>担任职务</td>");
        content.append("        <td width=20% height=32 align=center bgcolor=#F7F7F7 class=12>离职原因</td>");
        content.append("        </tr>");
        for (ResumeWorkInfo wk : resume.getResumeWorkList()) {
            content.append("      <tr>");
            content.append("        <td width=13% height=32 align=right>" + wk.getStart() + "至 </td>");
            content.append("        <td width=12% height=32 align=center>" + wk.getEnd() + "</td>");
            content.append("        <td height=32 align=center>" + wk.getCompany() + "</td>");
            content.append("        <td height=32 align=center>" + wk.getStation() + "</td>");
            content.append("        <td height=32 align=center>" + wk.getLeaveReason() + "</td>");
            content.append("        </tr>");
        }
        content.append("    </table></td>");
        content.append("  </tr>");
        content.append("  <tr>");
        content.append("    <td height=32 colspan=2 align=center class=table><table width=100% border=0 cellspacing=0 cellpadding=0>");
        content.append("      <tr>");
        content.append("        <td width=13% height=32 align=center bgcolor=#F7F7F7 class=12>最近工作单位：</td>");
        content.append("        <td width=87% class=12>&nbsp;</td>");
        content.append("      </tr>");
        content.append("    </table></td>");
        content.append("  </tr>");
        content.append("  <tr>");
        content.append("    <td height=32 colspan=2 align=center class=table><table width=100% border=0 cellspacing=0 cellpadding=0>");
        content.append("        <tr>");
        content.append("          <td width=13% height=32 align=center bgcolor=#F7F7F7 class=12>未处理事项： </td>");
        content.append("          <td width=87% class=12>&nbsp;</td>");
        content.append("        </tr>");
        content.append("    </table></td>");
        content.append("  </tr>");

        content.append("  <tr>");
        content.append("    <td height=129 colspan=2 align=center class=table><table width=100% border=0 cellspacing=0 cellpadding=0>");
        content.append("      <tr>");
        content.append("        <td width=13% height=170 align=center bgcolor=#F7F7F7 class=12>主要工作业绩： </td>");
        content.append("        <td width=87% class=12><label>" + resume.getPerformance() + "</label></td>");
        content.append("      </tr>");
        content.append("    </table></td>");
        content.append("  </tr>");

        content.append("  <tr>");
        content.append("    <td height=32 colspan=2 align=center bgcolor=#EFEFEF class=table><p align=center class=12>");
        content.append("<strong>技&nbsp;&nbsp;&nbsp;&nbsp;术&nbsp;&nbsp;&nbsp;&nbsp;专&nbsp;&nbsp;&nbsp;&nbsp;长</strong></p></td>");
        content.append("  </tr>");
        content.append("  <tr>");
        content.append("    <td height=32 colspan=2 align=center class=table><table width=100% height=32 border=0 cellpadding=0 cellspacing=0>");
        content.append("      <tr>");
        content.append("        <td width=23% height=32 align=center bgcolor=#F7F7F7>取得时间  </td>");
        content.append("        <td width=56% height=32 align=center bgcolor=#F7F7F7>取得何专业职称（技术）证书  </td>");
        content.append("        <td width=21% height=32 align=center bgcolor=#F7F7F7>发证单位</td>");
        content.append("      </tr>");

        for (ResumeCertificateInfo cf : resume.getResumeCertificaeList()) {
            content.append("      <tr>");
            content.append("        <td height=32 align=center>" + cf.getTime() + "</td>");
            content.append("        <td height=32 align=center>" + cf.getName() + "</td>");
            content.append("        <td height=32 align=center>" + cf.getCompany() + "</td>");
            content.append("      </tr>");
        }
        content.append("    </table></td>");
        content.append("  </tr>");
        content.append("  <tr>");
        content.append("    <td height=32 colspan=2 align=center class=table><table width=100% border=0 cellspacing=0 cellpadding=0>");
        content.append("      <tr>");
        content.append("        <td width=13% height=32 align=center bgcolor=#F7F7F7><p>家庭经济状况：<span lang=EN-US xml:lang=EN-US></span></p></td>");
        content.append("        <td width=87% height=32 align=center>&nbsp;</td>");
        content.append("      </tr>");
        content.append("    </table></td>");
        content.append("  </tr>");
        content.append("  <tr>");
        content.append("    <td height=32 colspan=2 align=center bgcolor=#EFEFEF class=table><strong class=12>应</strong><strong>&nbsp;&nbsp;</strong><strong class=12>聘</strong><strong>&nbsp;&nbsp;</strong><strong class=12>人</strong><strong>&nbsp;&nbsp;</strong><strong class=12>员</strong><strong>&nbsp;&nbsp;</strong><strong class=12>个</strong><strong>&nbsp;&nbsp;</strong><strong class=12>人</strong><strong>&nbsp;&nbsp;</strong><strong class=12>要</strong><strong>&nbsp;&nbsp;</strong><strong class=12>求</strong></td>");
        content.append("</tr>");
        content.append("<tr>");
        content.append("   <td height=32 colspan=2 align=center class=table><table width=100% border=0 cellspacing=0 cellpadding=0>");
        content.append("      <tr>");
        content.append("        <td width=13% height=32 align=center bgcolor=#F7F7F7>希望年收入：</td>");
        content.append("        <td width=41% height=32 align=center>&nbsp;</td>");
        content.append("        <td width=11% height=32 align=center bgcolor=#F7F7F7>其他要求：</td>");
        content.append("        <td width=35% height=32 align=center>&nbsp;</td>");
        content.append("      </tr>");
        content.append("    </table></td>");
        content.append("  </tr>");
        content.append("  <tr>");
        content.append("    <td height=32 colspan=2 align=center class=table><table width=100% border=0 cellspacing=0 cellpadding=0>");
        content.append("      <tr>");
        content.append("        <td width=14% height=32 align=center bgcolor=#F7F7F7><p>职业生涯设计：<span lang=EN-US xml:lang=EN-US></span></p></td>");
        content.append("        <td width=86% height=32>&nbsp;</td>");
        content.append("      </tr>");
        content.append("    </table></td>");
        content.append("  </tr>");
        content.append("  <tr>");
        content.append("    <td height=32 colspan=2 align=center class=table>&nbsp;</td>");
        content.append("  </tr>");
        content.append("  <tr>");
        content.append("    <td height=171 colspan=2 align=center class=table><table width=100% border=0 cellspacing=0 cellpadding=0>");
        content.append("      <tr>");
        content.append("        <td height=36 colspan=2 align=left bgcolor=#F7F7F7>部门意见：</td>");
        content.append("        <td colspan=2 align=left bgcolor=#F7F7F7>人力资源部意见：</td>");
        content.append("        <td colspan=2 align=left bgcolor=#F7F7F7>主管副总经理批示：</td>");
        content.append("        <td colspan=2 align=left bgcolor=#F7F7F7>董事长批示：</td>");
        content.append("      </tr>");
        content.append("      <tr>");
        content.append("        <td height=96 colspan=2>&nbsp;</td>");
        content.append("        <td colspan=2>&nbsp;</td>");
        content.append("        <td colspan=2>&nbsp;</td>");
        content.append("        <td colspan=2>&nbsp;</td>");
        content.append("      </tr>");
        content.append("      <tr>");
        content.append("        <td width=14% height=32 align=center bgcolor=#F7F7F7>签字：</td>");
        content.append("        <td width=18% align=center>&nbsp;</td>");
        content.append("        <td width=14% height=32 align=center bgcolor=#F7F7F7>签字：</td>");
        content.append("        <td width=19% align=center>&nbsp;</td>");
        content.append("        <td width=14% height=32 align=center bgcolor=#F7F7F7>签字：</td>");
        content.append("        <td width=19% align=center>&nbsp;</td>");
        content.append("        <td width=14% height=32 align=center bgcolor=#F7F7F7>签字：</td>");
        content.append("        <td width=19% align=center>&nbsp;</td>");
        content.append("      </tr>");
        content.append("    </table></td>");
        content.append("  </tr>");
        content.append("</table>");

        response.getWriter().print(content);
    }
}
